<?php

namespace App\ServicesNew;

use App\Entities\OrderEntity;
use App\Entities\OrderRefundEntity;
use App\Entities\PaymentEntity;
use App\VO\UserOrder\MetaInfo\UserOrderSearchInfo;

interface OrderService
{
    /**
     * @param int $orderId
     * @return OrderEntity|null
     */
    public function findOrderEntityById(int $orderId);

    /**
     * @param int $orderId
     * @param int $userId
     * @return OrderEntity|null
     */
    public function findOrderEntityByIdAndUserId(int $orderId, int $userId);

    /**
     * @param UserOrderSearchInfo $searchInfo
     * @return OrderEntity[]
     */
    public function getOrderEntities(UserOrderSearchInfo $searchInfo);

    /**
     * @param UserOrderSearchInfo $searchInfo
     * @return int
     */
    public function count(UserOrderSearchInfo $searchInfo);

    /**
     * 获取订单在一段时间内的数量
     * @param int $cityId
     * @param int $productId
     * @param string $day
     * @param string $timePeriodId
     * @return int
     */
    public function getOrderPeriodCount(int $cityId, int $productId, string $day, string $timePeriodId);

    /**
     * 获取订单的补充订单的交易数据
     * @param int $orderId
     * @param bool $includeMasterGoods
     * @return PaymentEntity[]
     */
    public function getSupplementPaymentsByOrderId(int $orderId, bool $includeMasterGoods = false);

    /**
     * 根据 OrderRefundId查找订单
     * @param int $orderId
     * @return OrderRefundEntity/null
     */
    public function findOrderRefundOneByOrderId(int $orderId);
}
